package com.project.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.PestBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 虫害持久层
 */
@Repository
public interface PestDao extends BaseMapper<PestBean> {
    /**
     * 分页显示所有虫害信息~~~
     * @return
     */
    List<PestBean> findAllPest();


    /**
     * 添加新虫害
     * @param pest
     */
    void addPest(PestBean pest);


    /**
     * 根据虫害id查询详细信息
     * @param pestId
     * @return
     */
    PestBean findId(@Param("pestId") int pestId);


    /**
     * 根据寄虫名、寄主模糊查询虫害信息
     * @param pestName
     * @param pestHost
     * @return
     */
    List<PestBean> findName(@Param("pestName")String pestName,
                            @Param("pestHost")String pestHost);
}
